<template>
  <el-button @click="btnClose">
    <svg-icon
      icon-class="guanbi"
      class-name="icon-svg"
    />
    <span>关闭</span>
  </el-button>

</template>
<script>
import Global from '@/../public/js/global'

export default {
  name: 'CloseButton',
  data() {
    return {

    }
  },
  methods: {
    btnClose() {
      // this.$store.dispatch("tagsView/delView", this.$route);
      //  this.$router.push('/dashboard')
      if (globalConfig.IS_AOM_WEB) {
        const arr = top.$('iframe')
        for (let i = 0; i < arr.length; i++) {
          if (arr[i].contentWindow === window) {
            let id = top.$(arr[i]).parent().attr('id')
            if (!id) return
            id = id.substring(id.lastIndexOf('_') + 1)
            top.$('#tab_a_' + id).find('.closeTab').click()
          }
        }
      } else {
        Global.mainPagesCloseSelf()
      }
    }
  }
}
</script>
